﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BioBooking.Data;

namespace BioBooking.WebClient
{
    public partial class Booking : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int movieID;
            if (!int.TryParse(Request["mid"], out movieID))
                Context.Response.Redirect("~/");

            BioBooking.Data.BioBookingContainer container = new Data.BioBookingContainer();
            Movie movie = container.MovieSet.FirstOrDefault(p=>p.Id == movieID);


            litMovieTitle.Text = movie.Titel;
            litShowingDate.Text = "UNKNOWN";
            litShowingTime.Text = "UNKNOWN";
            imgMovie.ImageUrl = String.Format("image.ashx?id={0}", movie.ScreenShot.FirstOrDefault().Id);
        }
    }
}